/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author YDZ
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../model/baseModel';

const { adminPath } = useGlobSetting();

export interface BasUserCusScope extends BasicModel<BasUserCusScope> {
  cusCode?: string; // 客户编码
  personCode?: string; // 用户编号
  ctrlType?: string; // 权限类型
}

export const basUserCusScopeList = (params?: BasUserCusScope | any) =>
  defHttp.get<BasUserCusScope>({ url: adminPath + '/bas/cus/basUserCusScope/list', params });

export const basUserCusScopeListData = (params?: BasUserCusScope | any) =>
  defHttp.post<Page<BasUserCusScope>>({
    url: adminPath + '/bas/cus/basUserCusScope/listData',
    params,
  });

export const basUserCusScopeForm = (params?: BasUserCusScope | any) =>
  defHttp.get<BasUserCusScope>({ url: adminPath + '/bas/cus/basUserCusScope/form', params });

export const basUserCusScopeSave = (params?: any, data?: BasUserCusScope | any) =>
  defHttp.postJson<BasUserCusScope>({
    url: adminPath + '/bas/cus/basUserCusScope/save',
    params,
    data,
  });

export const saveCusAndUser = (params?: any, data?: BasUserCusScope | any) =>
  defHttp.postJson<BasUserCusScope>({
    url: adminPath + '/bas/cus/basUserCusScope/saveCusAndUser',
    params,
    data,
  });

export const basUserCusScopeDelete = (params?: BasUserCusScope | any) =>
  defHttp.get<BasUserCusScope>({ url: adminPath + '/bas/cus/basUserCusScope/delete', params });

export const updateAuth = (params?: BasUserCusScope | any) =>
  defHttp.post<BasUserCusScope>({ url: adminPath + '/bas/cus/basUserCusScope/updateAuth', params });

export const deleteAuthCus = (params?: BasUserCusScope | any) =>
  defHttp.get<BasUserCusScope>({
    url: adminPath + '/bas/cus/basUserCusScope/deleteAuthCus',
    params,
  });
